<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ include file="/WEB-INF/jspf/taglibs.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div class="p-h-md p-v bg-white box-shadow pos-rlt">
  <h3 class="no-margin">广告管理</h3>
</div>
<div class="p-md">
  <div class="panel panel-default">
    <div class="panel-heading">广告列表</div>
    <div class="panel-body">
    <div class="pull-right hidden-xs w">
  </div>
      <a href="/ads/add?<%= Math.random() %>"><button type="button" ui-sref="app.add" class="btn btn-sm btn-success ng-click-active"> <i class="glyphicon glyphicon-plus"></i>
        新建广告
      </button></a>
    </div>
	<table class="table table-bordered table-hover bg-white">
      <thead>
        <tr>
          <th>广告名称</th>
          <th>起止时间</th>
          <th>曝光量</th>
          <th>点击数</th>
          <th>点击率</th>
          <th>出价</th>
          <th>点击均价</th>
          <th>花费</th>
          <th>状态</th>
        </tr>
      </thead>
      <tbody>
        </tbody><colgroup><col>
        <col width="9%">
        <col width="9%">
        <col width="9%">
        <col width="9%">
        <col width="9%">
        <col width="9%">
        <col width="9%">
        <col width="9%">
        <col width="7%">
        </colgroup>
        <tbody>
        <c:if test="${!empty form.ads}">
	        <c:forEach items="${form.ads }" varStatus="i" var="ad">
	        <tr>
	          <td>
	             <a href="/ads/detail/?crtSize=${ad.crtSize }">${ad.aname }</a>
	          </td>
	          <td>
	             -<fmt:formatDate value="${ad.endAt }" pattern="yyyy-MM-dd"/>
	          </td>
	          <td>${ad.pv }</td>
	          <td>${ad.pc }</td>
	          <td><fmt:formatNumber value="${ad.ctr }" maxFractionDigits="3" />%</td>
	          <td>￥<fmt:formatNumber value="${ad.bid /100}" maxFractionDigits="3" /></td>
	          <td>￥<fmt:formatNumber value="${ad.costPerClick }" maxFractionDigits="3" /></td>
	          <td>￥<fmt:formatNumber value="${ad.cost }" maxFractionDigits="3" /></td>
	          <td>
	          <label class="ui-switch bg-info">
	            <input type="checkbox" class="ng-valid ng-dirty" disabled checked="checked">
	            <i></i>
	          </label>
	          <div class="text-danger-dk">在投</div>
	          </td>
	        </tr>
	        </c:forEach>
        </c:if>
      </tbody>
    </table>
  </div>
</div>
</body>
</html>